import $C from '@/common/config.js'

export default {
	// /realEstatePart/getByParent
	async getChildNode() {
		const data = await uni.$H.get('/realEstatePart/getByParent', {
			parentId: "1"
		}, {
			authCode: true
		})
		if (data.status !== 0) {
			uni.$showMsg(data.message)
			return []
		} else {
			return data.body
		}
	},
	async getConstentPartId(para) {
		let arra = await this.getChildNode()
		console.log(arra)
		// let id = arra.filter((l) => l.partName == para)
		for (let i = 0; i < arra.length; i++) {
			if (arra[i].partName === para) {
				console.log(arra[i])
				return arra[i].partId
			}
		}
		// switch (para) {
		// 	case '地产信息':

		// 		break;
		// 	case '房产信息':
		// 		break;
		// 	case '项目大事记':
		// 		break;
		// 	case '房屋节点':
		// 		break;
		// }
		return '1'
	},
	privacyTreatyId: 'fecmzvefuiezpvhdfwsocbvpcdzroruxnbaynnczphyagouiayrwtbzhuhbuhuem',
	userTreatyId: 'zknboyaitksthudndlvrxrsivbeddfkiggvftvhvizauasdzfbwxykgdldbbutaq',
	downloadURL(para) {
		let xxoo = '/qualityIssue/export?estateId=' + para.estateId + '&issuesType=' + para.issuesType +
			'&issuesStatus=' + para.issuesStatus + '&estateIds=' + para.estateIds
		let url = $C.baseUrl + xxoo
		return url
	}
}
